home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / usr_-_Usr_Files / INCLUDE / UTMP.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  2KB  |  92 lines

  1. /* utmp.h for Linux, by poe@daimi.aau.dk */
  2.  
  3. #ifndef UTMP_H
  4. #define UTMP_H
  5.  
  6. #include <features.h>
  7. #include <sys/types.h>
  8. #include <sys/time.h>
  9. #include <time.h>
  10. #include <sys/wait.h>
  11. #include <paths.h>
  12.  
  13. #define UTMP_FILE    _PATH_UTMP
  14. #define WTMP_FILE    _PATH_WTMP
  15.  
  16. #define UTMP_FILENAME    UTMP_FILE
  17. #define WTMP_FILENAME    WTMP_FILE
  18.  
  19. /* defines for the ut_type field */
  20. #define UT_UNKNOWN    0
  21.  
  22. #define RUN_LVL        1
  23. #define BOOT_TIME    2
  24. #define NEW_TIME    3
  25. #define OLD_TIME    4
  26.  
  27. #define INIT_PROCESS    5
  28. #define LOGIN_PROCESS    6
  29. #define USER_PROCESS    7
  30. #define DEAD_PROCESS    8
  31.  
  32.  
  33. /* size of user name */
  34. #if 1
  35. #define UT_LINESIZE    12
  36. #define UT_NAMESIZE    8
  37. #define UT_HOSTSIZE    16
  38.  
  39. struct utmp
  40. {
  41.     short    ut_type;    /* type of login */
  42.     pid_t    ut_pid;        /* pid of login-process */
  43.     char    ut_line[UT_LINESIZE];    /* devicename of tty -"/dev/", null-term */
  44.     char    ut_id[4];    /* inittab id */
  45.     time_t    ut_time;    /* login time */
  46.     char    ut_user[UT_NAMESIZE];    /* username, not null-term */
  47.     char    ut_host[UT_HOSTSIZE];    /* hostname for remote login... */
  48.     long    ut_addr;    /* IP addr of remote host */
  49. };
  50.  
  51. #else
  52.  
  53. #define UT_LINESIZE    32
  54. #define UT_NAMESIZE    32
  55. #define UT_HOSTSIZE    256
  56.  
  57. struct utmp
  58. {
  59.     short    ut_type;    /* type of login */
  60.     pid_t    ut_pid;        /* pid of login-process */
  61.     char    ut_line[UT_LINESIZE];    /* devicename of tty -"/dev/", null-term */
  62.     char    ut_id[4];    /* inittab id */
  63.     char    ut_user[UT_NAMESIZE];    /* username, not null-term */
  64.     char    ut_host[UT_HOSTSIZE];    /* hostname for remote login... */
  65.     int    ut_exit;    /* process termination/exit status */
  66.     struct    timeval ut_tv;    /* time entry was made */
  67.     long    ut_session;    /* session ID, used for windowing */
  68.     long    ut_addr;    /* IP addr of remote host */
  69.     char    pad [8];    /* reserved for future use */
  70. };
  71.  
  72. #define ut_time ut_tv.tv_sec 
  73.  
  74. #endif
  75.  
  76. #define ut_name ut_user
  77.  
  78. __BEGIN_DECLS
  79.  
  80. extern void        setutent __P ((void));
  81. extern void        utmpname __P ((__const char *));
  82. extern struct utmp    *getutent __P ((void));
  83. extern struct utmp    *getutid __P ((struct utmp *));
  84. extern struct utmp     *getutline __P ((struct utmp *));
  85. extern void        pututline __P ((struct utmp *));
  86. extern struct utmp    *_getutline __P ((struct utmp *));
  87. extern void        endutent __P ((void));
  88.  
  89. __END_DECLS
  90.  
  91. #endif    
  92.